<?php if(!isset($cosa)) die(); ?>
<div id="login">
	
	<div class="loginTop">
		<h1><span>Cosa</span></h1>
		<a href="<?php echo $cosa->system('site-url'); ?>/" class="fl-r homelink"><?php $lang->put('back-to-site'); ?></a>
	</div>
	
	<form method="post" action="<?php echo $cosa->system('base-url').'/'; if(isset($_REQUEST['m'])) echo '?m='.$_REQUEST['m']; if(isset($_REQUEST['m']) && isset($_REQUEST['s'])) echo '&s='.$_REQUEST['s']; ?>" name="loginF" class="loginF" onsubmit="return validateLogin(this);">
	<input type="hidden" name="validate" value="true" />
	<input type="hidden" name="login" value="1" />
	<ul>
		<li><label for="uname"><?php $lang->put('login-uname'); ?></label>
			<input type="text" name="uname" value="<?php if(isset($_POST['uname'])) echo $_POST['uname']; ?>" class="fld" />
		</li>
		<li><label for="pass"><?php $lang->put('login-pass'); ?></label>
			<input type="password" name="pass" value="" class="fld" />
		</li>
		<li>
			<input type="submit" value="<?php $lang->put('login-submit'); ?>" class="sbmt" />
		</li>
	</ul>
	</form>
	
	<div id="login-failed"<?php if(!isset($loginAttempt)) echo ' style="display:none;"'; ?>>
		<?php if(!isset($loginAttempt)) $lang->put('login-failed'); echo "\n"; ?>
	</div>
	
</div>

<script type="text/javascript">
$(document).ready(function() { document.loginF.uname.focus(); });
</script>